package com.cloudkinto.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author 张永远
 * @since 2020-05-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_user")
public class UserDo extends Model<UserDo> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 账号
     */
    @TableField("user_account")
    private String userAccount;

    /**
     * 0 客户全部可见 1部分可见
     */
    @TableField("white_cus")
    private Integer whiteCus;

    /**
     * 0 仓库全部可见 1部分可见
     */
    @TableField("white_wh")
    private Integer whiteWh;

    /**
     * 用户类型1：老项目角色 2客户角色3：后台角色
     */
    @TableField("user_type")
    private Integer userType;

    /**
     * 租户id 后台用户用 隔离仓库等
     */
    @TableField(value = "tenant_id", fill = FieldFill.INSERT)
    private Long tenantId;

    /**
     * 用户名
     */
    @TableField("user_name")
    private String userName;

    /**
     * 密码
     */
    @TableField("user_password")
    private String userPassword;

    /**
     * 邮箱
     */
    @TableField("user_mail")
    private String userMail;

    /**
     * 电话
     */
    @TableField("user_phone")
    private String userPhone;


    /**
     * 用户状态 0未审核 1通过 2禁用
     */
    @TableField("user_status")
    private Integer userStatus;

    /**
     * 角色id
     */
    @TableField("role_id")
    private Long roleId;



    /**
     * 头像  文件id
     */
    @TableField("head_file_id")
    private Long headFileId;

    /**
     * 公司id
     */
    @TableField("company_id")
    private Long companyId;

    @TableField(value = "create_by", fill = FieldFill.INSERT)
    private Long createBy;

    @TableField("last_login_time")
    private Date lastLoginTime;
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(value = "update_by", fill = FieldFill.UPDATE)
    private Long updateBy;

    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private Date updateTime;


    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
